﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hinacom.Scheduler
{
    /// <summary>
    /// 用于修饰一个JobInfo子类，指明该子类使用的JobInfoConverter的实现类。
    /// </summary>
    public class JobInfoConverterAttribute : Attribute
    {
        /// <summary>
        /// 用于转换JobInfo子类的JobInfoConverter的实现类。
        /// </summary>
        public Type Type { get; set; }
    }
    /// <summary>
    /// 当尝试转换一个JobInfo子类时，若该子类没有指定JobInfoConverterAttribute，触发此错误。
    /// </summary>
    public class JobInfoConverterAttributeMissingException : Exception
    {
        public JobInfoConverterAttributeMissingException(Type type)
        {
            this.type = type;
        }

        private Type type;

        public override string Message
        {
            get
            {
                return String.Format("The type \"{0}\" cannot be converted to Quartz JobDetail object because its JobInfoConverterAttribute is missing.", type.FullName);
            }
        }

    }
}
